package com.speech.utils;

import android.content.Context;

import com.speech.constant.PrefsConstant;
import com.speech.db.SharedPreferenceHelper;

public class MissionNoobFinishState {

    private static Boolean GONGZHONGHAO_STATE = false;
    private static Boolean SHEQU_STATE = false;
    private static Boolean NICKNAME_STATE = false;
    private static Boolean HEAD_PICTURE_STATE = false;

    public static void init(Context context) {
        SharedPreferenceHelper spf = new SharedPreferenceHelper(context, PrefsConstant.FILE_NOOB_MISSION_FINISH_STATE);
        GONGZHONGHAO_STATE = (Boolean) spf.getData(PrefsConstant.KEY_NOOB_MISSION_GONGZHONGHAO_IS_FINISH, SharedPreferenceHelper.BOOLEAN_TYPE_DEFAULT);
        SHEQU_STATE = (Boolean) spf.getData(PrefsConstant.KEY_NOOB_MISSION_SHEQU_IS_FINISH, SharedPreferenceHelper.BOOLEAN_TYPE_DEFAULT);
        NICKNAME_STATE = (Boolean) spf.getData(PrefsConstant.KEY_NOOB_MISSION_NICKNAME_IS_FINISH, SharedPreferenceHelper.BOOLEAN_TYPE_DEFAULT);
        HEAD_PICTURE_STATE = (Boolean) spf.getData(PrefsConstant.KEY_NOOB_MISSION_HEAD_PICTURE_IS_FINISH, SharedPreferenceHelper.BOOLEAN_TYPE_DEFAULT);
    }

    public static Boolean getGongzhonghaoState() {
        return GONGZHONGHAO_STATE;
    }

    public static void setGongzhonghaoState(Boolean isFinish, Context context) {
        GONGZHONGHAO_STATE = isFinish;
        if (isFinish) {
            SharedPreferenceHelper spf = new SharedPreferenceHelper(context, PrefsConstant.FILE_NOOB_MISSION_FINISH_STATE);
            spf.putData(PrefsConstant.KEY_NOOB_MISSION_GONGZHONGHAO_IS_FINISH, true);
        }
    }

    public static Boolean getShequState() {
        return SHEQU_STATE;
    }

    public static void setShequState(Boolean isFinish, Context context) {
        SHEQU_STATE = isFinish;
        if (isFinish) {
            SharedPreferenceHelper spf = new SharedPreferenceHelper(context, PrefsConstant.FILE_NOOB_MISSION_FINISH_STATE);
            spf.putData(PrefsConstant.KEY_NOOB_MISSION_SHEQU_IS_FINISH, true);
        }
    }

    public static Boolean getNicknameState() {
        return NICKNAME_STATE;
    }

    public static void setNicknameState(Boolean isFinish, Context context) {
        NICKNAME_STATE = isFinish;
        if (isFinish) {
            SharedPreferenceHelper spf = new SharedPreferenceHelper(context, PrefsConstant.FILE_NOOB_MISSION_FINISH_STATE);
            spf.putData(PrefsConstant.KEY_NOOB_MISSION_NICKNAME_IS_FINISH, true);
        }
    }

    public static Boolean getHeadPictureState() {
        return HEAD_PICTURE_STATE;
    }

    public static void setHeadPictureState(Boolean isFinish, Context context) {
        HEAD_PICTURE_STATE = isFinish;
        if (isFinish) {
            SharedPreferenceHelper spf = new SharedPreferenceHelper(context, PrefsConstant.FILE_NOOB_MISSION_FINISH_STATE);
            spf.putData(PrefsConstant.KEY_NOOB_MISSION_HEAD_PICTURE_IS_FINISH, true);
        }
    }
}
